#ifndef SYMBOLFUNCTION_HPP
#define SYMBOLFUNCTION_HPP

#include <vector>
#include "Symbol.hpp"
#include "TypeBase.hpp"

	typedef enum {
		ARG_VAR, 
		ARG_VAL
	} ArgType;
class SymbolArgument : public Symbol {

	private:
		ArgType argType;
		int position;

	public: 
		SymbolArgument(TypeBase *typeBase, ArgType argType){
			this->t = typeBase;
			this->argType = argType;
			this->position = 1;
		}
		~SymbolArgument(){
			delete t;
		}
		void show(){
			std::cout << "argument\tmode:";
			if(this->isVariable())
				std::cout << "variable";
			else
				std::cout << "constant";
			std::cout << ",type:";
			t->show();
			std::cout << ",position:" << this->position;
		}

		void setPosition(int pos){
			this->position=pos;
		}
		bool isVariable(){
			return argType == ARG_VAR;
		}
		bool isValue(){
			return argType == ARG_VAL;
		}
};


typedef std::vector<SymbolArgument *> ListArguments;
class SymbolFunctProc : public Symbol {
	protected: 
		ListArguments * listArgs;
		

};


class SymbolFunction : public SymbolFunctProc{
	private:
		TypeBase * typeRet;

	public:
		SymbolFunction(TypeBase* typeReturn, ListArguments * listArguments){
			this->typeRet = typeReturn;
			this->listArgs = listArguments;
		}
		~SymbolFunction(){
			delete this->typeRet;
			delete this->listArgs;
		}
		void show(){
			std::cout << "fonction\t";
			std::cout << "arite:" << listArgs->size() << ",typeretour:";
			typeRet->show();
		}
};

class SymbolProcedure : public SymbolFunctProc {
	private:
		ListArguments * listArgs;

	public:
		SymbolProcedure(ListArguments * listArguments){
			this->listArgs = listArguments;
		}
		~SymbolProcedure(){
			delete this->listArgs;
		}
		void show(){
			std::cout << "procedure\t";
			std::cout << "arite:" << listArgs->size();
		}
};


#endif
